package com.pai4j.remote.sso;
import com.pai4j.common.bean.PAIResponseBean;
import com.pai4j.domain.vo.request.request.UserLoginInfoRequestVO;
import com.pai4j.domain.vo.request.request.UserRegistryInfoRequestVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "pai4j-sso-service", contextId = "oauthServiceClient")
public interface OauthServiceClient {

    @GetMapping("/sso-service/oauth/uid/{oauthCode}")
    PAIResponseBean<String> getUidByOauthCode(@PathVariable String oauthCode);

    @GetMapping("/sso-service/oauth/genLoginOauthCode/{uid}")
    PAIResponseBean<String> genLoginOauthCode(@PathVariable String uid);

    @PostMapping("/sso-service/oauth/register")
    PAIResponseBean register(@RequestBody UserRegistryInfoRequestVO request);

    @PostMapping("/sso-service/oauth/login")
    PAIResponseBean<String> login(@RequestBody UserLoginInfoRequestVO loginInfoRequest);
}
